{% extends "base.html" %}

{% block content %}
<h3>{{ reader.user.username }}</h3>

{% if user.is_authenticated %}
<p>Hi {{ user.get_full_name }}. Would you like to <a href="/admin/auth/user/{{ reader.user.id }}/">change this reader</a>?</p>
{% endif %}

{% if reader.get_picture_url %}
<img class="reader_picture" src="{{ reader.get_picture_url }}" />
{% endif %}

<p>Full name: <strong>{{ reader.name }}</strong><br />
Total recorded reads: <strong>{{ reader.readingoccasion_set.count }}</strong></p>

<p class="bio">{{ reader.bio }}</p>

<table>
<thead>
<tr>
    <th>Book</th>
    <th>Date</th>
    <th>Hours</th>
    <th>Notes</th>
</tr>
</thead>
<tbody>

{% for ro in readingoccasion_list %}
    <tr>
        <td class="name_col"><a href="{{ ro.book.get_absolute_url }}">{{ ro.book.title }}</a></td>
        <td class="date_col">{{ ro.finished|date:"j M Y" }}</td>
        <td class="num_col">{{ ro.reading_time }}</td>
        <td>{% firstof ro.notes "-" %}</td>
    </tr>
{% endfor %}

</tbody>
</table>

{% include "frag_next_prev.html" %}
{% endblock %}
